package net.xdclass.video.controller;

import net.xdclass.video.common.Result;
import net.xdclass.video.entity.Genre;
import net.xdclass.video.service.GenreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class GenreController {
    @Autowired
    private GenreService genreService;
    //类型
    @GetMapping("/apiOne/genre/finAll")
    public Result finAll(){
       List<Genre> genreList= genreService.list();
       return Result.success(genreList);
    }

    //年份
    @GetMapping("/apiOne/genre/yearFinAll")
    public Result YearFinAll(){
        List<Genre> genreList= genreService.yearList();
        return Result.success(genreList);
    }

    //剧情
    @GetMapping("/apiOne/genre/storyFinAll")
    public Result storyFinAll(){
        List<Genre> genreList= genreService.storyFinAll();
        return Result.success(genreList);
    }

    //地区
    @GetMapping("/apiOne/genre/districtFinAll")
    public Result districtFinAll(){
        List<Genre> genreList= genreService.districtFinAll();
        return Result.success(genreList);
    }

    //电视剧类型
    @GetMapping("/apiOne/genre/regionFinAll")
    public Result regionFinAll(){
        List<Genre> genreList= genreService.regionFinAll();
        return Result.success(genreList);
    }
    //电视剧剧情
    @GetMapping("/apiOne/genre/plotFinAll")
    public Result plotFinAll(){
        List<Genre> genreList= genreService.plotFinAll();
        return Result.success(genreList);
    }


   }
